Skip to content

Fix treadmill pause watts and Stryd steps - #4803

Draft
cagnulein wants to merge 7 commits into
masterfrom
codex/4480-stryd-steps-fix
Draft

Fix treadmill pause watts and Stryd steps#4803
cagnulein wants to merge 7 commits into
masterfrom
codex/4480-stryd-steps-fix

Conversation

@cagnulein

@cagnulein cagnulein commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

Refs #4480.

This PR fixes treadmill-side issues found while analyzing the Stryd logs attached to issue #4480:

  • keep calculated watts populated while paused when instant_power_on_pause is enabled
  • show raw watts in UI/templates while paused when instant_power_on_pause is enabled, instead of using 3s/5s averaged watts that can be empty while metrics are paused
  • update treadmill step calculation when cadence arrives from an external sensor such as Stryd
  • add a Power Sensor Options setting for the Stryd/treadmill speed correction threshold, defaulting to 20%

Root cause

treadmill::update_metrics() had its own paused handling and did not honor instant_power_on_pause, so watts could be reset to zero while paused even though the global setting was enabled.

The template watt value uses wattsMetricforUI(). With power_avg_3s enabled, that path reads the harmonic average buffer. While paused, metric::setValue() updates the raw value but does not populate the average buffers, so templates could show watts: 0 even though the current watt value and kgwatts were nonzero.

The external cadence path treadmill::cadenceSensor() only updated Cadence; unlike other cadence update paths, it did not call evaluateStepCount(), so Stryd cadence did not feed the step counter.

The Stryd/treadmill speed correction threshold was hardcoded at 20%, which made it hard to test whether a wider threshold improves HR PID behavior when Stryd speed and treadmill raw speed differ.

Validation

  • inspected the attached issue logs and confirmed the relevant settings and Stryd data path
  • ran git diff --check

No runtime device test was run locally.

@cagnulein
cagnulein force-pushed the codex/4480-stryd-steps-fix branch from 5bb87a2 to fc767d8 Compare July 12, 2026 05:37
@cagnulein cagnulein linked an issue Jul 12, 2026 that may be closed by this pull request
@stale

stale Bot commented Jul 28, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Jul 28, 2026
cagnulein and others added 4 commits July 29, 2026 20:12
Stryd 5 pods broadcast a power value that already compensates for the
treadmill incline on their own, even when no incline is entered in the
Stryd app. This conflicts with QZ's own inclination gain formula and
makes the reported power unreliable when running on an incline.

BLE sniffing (thanks @AndreaPro) found that writing 15 00 to the
proprietary characteristic 7e78aa18-72cd-d3b8-a81f-5b7e589bea0f puts
the pod into Indoor mode, where it stops adjusting power for incline
on its own, leaving QZ's own formula as the only source of the
correction. The pod resets to Outdoor mode automatically on
disconnect, so no cleanup is needed on our side.

Refs #4480
Andrea found (via BLE sniffing) that the Stryd5 pod acknowledges the
15 00/15 01 mode write on characteristic 7e78aa19, echoing the
confirmed mode back in byte 2. Track that ack and resend the Indoor
mode request (up to 3 times, 1s apart) if it's not received, in case
the initial write is missed or the pod boots into Outdoor mode.

Refs #4480
The mode-switch write was targeting 7e78aa18, which is the service
UUID, not a characteristic UUID - the service only exposes two
characteristics, 7e78aa20 (write, handle 33) and 7e78aa19 (notify,
handle 35), confirmed from Andrea's GATT discovery log. The write
never matched any characteristic, so the mode switch silently never
fired. Target 7e78aa20 instead.

Refs #4480
…eps-fix

# Conflicts:
#	src/qzsettings.cpp
#	src/settings-catalog.json
#	src/settings.qml
@stale stale Bot closed this Aug 7, 2026
@cagnulein cagnulein reopened this Aug 8, 2026
@stale stale Bot removed the wontfix This will not be worked on label Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Treadmill Auto-adjust Speed by Power

1 participant